home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dino Crisis Digital Press Kit
/
Dino Crisis Digital Press Kit.iso
/
mac
/
Xtras
/
Director 6.5 Behaviors
/
Cursor Behavior Library.cst
/
00002_Script_Rollover Animate
< prev
next >
Wrap
Text File
|
1998-04-19
|
4KB
|
128 lines
-- Cursor Rollover Animate
------------------------------------------------------------------------
--
--This behavior creates an animated cursor when you roll over the sprite it is attached to
--The required parameters are:
--
--Animation:
-- OnMouseEnter, Animates when the mouse is over the sprite.
-- OnMouseExit, Animates when the mouse is not over the sprite.
-- Always, Allways animate the cursor.
-- Never, Never animate.
--
--First cast member: The first member of the animation
--
--Last cast member: The last cast member of the animation
--Note: This behavior creates and then deletes the cursor displayed
--
-- Declare the properties used by this behavior.
property pCursorMember, pStartMember, pEndMember, pAnimateFlag, pShowFlag
on beginSprite me
-- The name of the cursor cast member crated by this sprite
put the member of sprite the spriteNum of me into myMember
set tempName = "Cursor For Sprite " & the spriteNum of me & " Member - " & myMember
set pCursorMember = new(#cursor)
set the name of pCursorMember = tempName
if member tempname <> member pCursorMember then
set tempCur = pCursorMember
set pCursorMember = member tempname
erase member tempCur
end if
put the memberNum of member pStartMember into startPoint
put the memberNum of member pEndMember into endPoint
set templist = []
repeat with i = startPoint to endPoint
put the type of member i into tempType
if tempType = #richText then
append tempList, member i
else if tempType = #bitmap then
if the depth of member i = 8 then
append tempList, member i
end if
end if
end repeat
set the castMemberList of member pCursorMember = templist
if pAnimateFlag = #Allways then
set the interval of member pCursorMember = 100
else
set the interval of member pCursorMember = -1
end if
cursor(member pCursorMember)
end
on mouseEnter me
if pAnimateFlag = #OnMouseEnter then
cursor member pcursormember
set the interval of member pCursorMember = 100
else if pAnimateFlag = #OnMouseExit then
set the interval of member pCursorMember = -1
end if
end
on mouseLeave me
if pAnimateFlag = #OnMouseEnter then
set the interval of member pCursorMember = -1
else if pAnimateFlag = #OnMouseExit then
cursor member pcursormember
set the interval of member pCursorMember = 100
end if
end
on endSprite me
erase member pCursorMember
end
-- The following handlers set up behaviors for the
-- behavior inspector.
on getPropertyDescriptionList
set p_list = [ ¨
#pAnimateFlag:[ #comment: "Animation:", ¨
#format: #symbol, ¨
#range: [#Always, #OnMouseEnter, #OnMouseExit, #None ],¨
#default: #OnMouseEnter], ¨
#pStartMember:[ #comment: "First cast member:", ¨
#format: #member, ¨
#default: "member 1 of castlib 1"], ¨
#pEndMember:[ #comment: "Last cast member:", ¨
#format: #member, ¨
#default: "member 1 of castlib 1"] ¨
]
return p_list
end
-- The following text is displayed in the Behavior Inspector
-- when this behavior is selected
on getBehaviorDescription
return ¨
"This behavior creates an animated cursor when you roll over the sprite it is attached to" & Return & ¨
"The required parameters are:" & return & return &¨
"Animation: " & return & ¨
" OnMouseEnter, Animates when the mouse is over the sprite." & return &¨
" OnMouseExit, Animates when the mouse is not over the sprite." & return &¨
" Always, Always animate the cursor." & return &¨
" Never, Never animate." & return & return &¨
"First cast member: The first member of the animation" & return & ¨
"Last cast member: The last cast member of the animation" & return & ¨
"Note: This behavior creates and then deletes the cursor member displayed"
end